{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Index(['emotion', ' Usage', ' pixels'], dtype='object')\n",
      "(35887, 3)\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "\n",
    "import numpy as np\n",
    "import  pandas as pd\n",
    "\n",
    "data_root = r'~/yan_path/dev/dataSets/FERPlus/'\n",
    "\n",
    "root_csv = os.path.join(data_root,'icml_face_data.csv')\n",
    "\n",
    "df = pd.read_csv(root_csv)\n",
    "print(df.columns)\n",
    "data_emotion = df['emotion']\n",
    "data_usage = df[' Usage']\n",
    "data_pixels = df[' pixels']\n",
    "\n",
    "data = pd.concat([data_emotion,data_pixels,data_usage], axis=1)\n",
    "print(data.shape)\n",
    "\n",
    "# data.to_csv(os.path.join(data_root,'split_data','face_data.csv'),index=False)\n",
    "# PrivateTest, PublicTest\n",
    "\n",
    "train_data = data.iloc[:28708,:]\n",
    "train_data.to_csv(os.path.join(data_root,'split_data','train.csv'),index=False)\n",
    "test_data = data.iloc[28708:,:]\n",
    "train_data.to_csv(os.path.join(data_root,'split_data','test.csv'),index=False)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "yan_env",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
